package edu.ynmd.cvs.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class PublicAction {
    //字符型
    @RequestMapping("getstr")
    @ResponseBody
    public String getStr() throws Exception{
        return "hello，spring boot";
    }

    //数字型
    @GetMapping("getNumber")
    @ResponseBody
    public int getNumber() throws Exception{
        return 100;
    }

    //逻辑型
    @GetMapping("getBoolean")
    @ResponseBody
    public boolean getBoolean() throws Exception{
        return true;
    }

    //日期型
    @GetMapping("getDate")
    @ResponseBody
    public Date getDate() throws  Exception{
        return new Date();
    }
}
